Repository navigation
git-artifacts: build with Rust - #140
Merged
Merged
Conversation
This reverts "git-artifacts: opt out of the Rust bits for now", which deferred building with Rust (the upstream default since 32d5b905909e7 (Enable Rust by default)) until Git for Windows would drop Windows 8.1 support, as tracked in git-for-windows/git#6276 That happened in v2.56.0, and the SDK artifacts this workflow relies on now include the Rust toolchain (see #132 and git-for-windows#67). Assisted-by: GitHub Copilot Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
chrisd8088
added a commit
to git-lfs/git-lfs
that referenced
this pull request
Nov 27, 2026
In our integration shell test suite, our tests of the "pure" SSH-based Git LFS object transfer protocol use the "git-lfs-transfer" program from the "scutiger-lfs" Rust crate. In the script used by our GitHub Actions CI workflow to run our test suite, we therefore compile this Rust crate before running any tests. One of the "scutiger-lfs" crate's dependencies is the "libz-sys" crate, and recently the job in our CI workflow that runs on Windows began to fail when attempting to compile the build script of the "libz-sys" crate. This failure stems from a recent change made to the "minimal" SDK provided by the Git for Windows project, which our Windows CI job installs in order to provide several binaries required by our shell tests and Makefile recipes, including the "msgfmt.exe" binary. In PR git-for-windows/git-sdk-64#132, Rust support was added to the SDK, and then in PR git-for-windows/git-sdk-64#140, Rust was enabled by default, as Rust is expected to be required to build version 3.0 of Git, whenever that is released. However, the minimal SDK's manifest does not include the MinGW-w64 C Runtime (CRT) package's Windows API import libraries "libole32.a" and "liboleaut32.a", which provide the symbols of the "ole32.dll" and "oleaut32.dll" system dynamic-link libraries: https://github.com/git-for-windows/git-sdk-64/blob/4817186b4c57df6e3e7972aa7fc234182f9ef8a0/.sparse/minimal-sdk The "libz-sys" crate's build script links against the Rust Standard Library, which in turn requires the "libole32.a" and "liboleaut32.a" libraries. https://github.com/rust-lang/libz-sys/blob/1.1.8/build.rs#L1-L6 https://github.com/rust-lang/rust/blob/1.100.0/src/bootstrap/src/core/build_steps/dist.rs#L272-L292 When these libraries can not be located, the "libz-sys" crate's build script can not be compiled, and our Windows CI job fails as a result. To avoid this problem, we now adjust our "script/cibuild" script so that on Windows it adjusts the system PATH environment variable to place the location of the default Rust tools provided by the GitHub Actions runner ahead of those provided by the Git for Windows SDK. We then also explicitly export the RUSTUP_TOOLCHAIN environment variable with a value of "stable-x86_64-pc-windows-msvc", which selects the default Rustup toolchain for the Microsoft Visual C++ (MSVC) ABI on x86 64-bit Windows systems: https://rust-lang.github.io/rustup/installation/windows.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is part of building Git for Windows with Rust by default, the remaining checkbox of git-for-windows/git#6276. The matching change in git-for-windows/git-for-windows-automation removes the same opt-out from its
git-artifactsandbuild-and-deployworkflows.